<?php
/**
 * @filesource /modules/user/Form/Register.php
 * @abstract Generate a register form, where no lable is set
 *     see /modules/user/views/register/register.phtml for how the form is generated.
 */
class user_Form_ChangePass extends Zend_Form
{

    protected $_noDecorator = array(
        'ViewHelper', 
        'Errors'
    );

    public function cluBuild($id)
    {
    
        // set the method for the display form to POST
        $this->setMethod('post');
//		$this->setAction("user/account/change-pass?id=".$id); 
        $this->setAction($this->getView()->hvnUrl(array('action' => 'change-pass'),'account').'?id='.$id);
		//common filters & validators for all fields
        $filterTrim = new Zend_Filter_StringTrim();
        $validatorNotEmpty = new Zend_Validate_NotEmpty();
        $validatorNotEmpty->setMessage(t(418));

        
        // new pass
        $pass = new Zend_Form_Element_Password('pass',  array('disableLoadDefaultDecorators' => true,
                                                                 'required' => true));
        $pass->addValidator($validatorNotEmpty, true)
                 ->addValidator(new Zend_Validate_StringLength(3))
                 ->addDecorators($this->_noDecorator);
                 
        $this->addElement($pass);
 
        // new pass again
        $pass2 = new Zend_Form_Element_Password('pass2',  array('disableLoadDefaultDecorators' => true,
                                                                 'required' => true));
        //TODO: needed?
        //$validatorPassword = new Clu_Validate_PasswordMatch('pass');
        //$validatorPassword->setMessage(__('Passwords do not match'));
        //$pass2->addValidator($validatorPassword)
          $pass2->addDecorators($this->_noDecorator);
        
        $this->addElement($pass2);

               
        //submit
        // add the submit button
        $submit = new Zend_Form_Element_Submit('submit', array('disableLoadDefaultDecorators' => true, 
                                                               'label' => t(59) ));
        $submit->addDecorators($this->_noDecorator);
        $this->addElement($submit);

    }
}

?>